package Java.Class;

public class Clock {
    Display hours = new Display(24);
    Display minute = new Display(60);

    public void start() {
        while (true) {
            minute.increase();
            if (minute.getValue() == 0) {
                hours.increase();
            }
            System.out.printf("%02d:%02d\n", hours.getValue(), minute.getValue());
        }
    }

    public static void main(String[] args) {
        Clock clock = new Clock();
        clock.start();
    }
}
